package cn.yunhe.entity;

import lombok.Data;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Data
/*
例二，主要是练习注入
 */
@Getter
@Component
public class MainFrame {




    private String modelType;
    //给MainFrame类的属性赋值在MainFrame类中用setter方法加注解
    @Value(value = "大水牛")
    public void setModelType(String modelType) {
        this.modelType = modelType;
    }
    public void printMainInfo(){
        System.out.println("计算机的型号为"+modelType);
    }
}
